package com.vooda.dao;

import com.vooda.entity.Ticket;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 * @author KennyDavid
 */
public interface TicketDao extends JpaRepository<Ticket, Long>, JpaSpecificationExecutor<Ticket> {

    /**
     * 查询商户下的优惠券
     *
     * @param isDel   是否删除
     * @param storeId 商户id
     * @return list
     */
    List<Ticket> findAllByIsDelAndStoreIdOrderByCreateTimeDesc(Boolean isDel, Long storeId);

    /**
     * 查询所有福袋
     *
     * @param isHappyBag 是否为福袋
     * @param isDel      是否删除
     * @return list
     */
    List<Ticket> findAllByIsHappyBagAndIsDel(Boolean isHappyBag, Boolean isDel);


}
